vcMessageBox

Message box services.

See in: Overview

Module: vcCore

Parent: -

Children -

Referenced by: -

Methods

Learn how to use methods here. The methods are also inherited from the parent class.

NameReturn TypeParametersDescription
showvcMessageBoxResultString messageDisplays a message box with a message.
See more
Parameters:
message (String): Message to be displayed.

Returns:
vcMessageBoxResult: Value that specifies which message box button is clicked by the user.
showvcMessageBoxResultString message,
String caption
Displays a message box with a message and title bar caption.
See more
Parameters:
message (String): Message to display.
message (String): Caption to display.

Returns:
vcMessageBoxResult: Value that specifies which message box button is clicked by the user.
showvcMessageBoxResultString message,
String caption,
vcMessageBoxButton button
Displays a message box with a message, title bar caption and buttons.
See more
Parameters:
message (String): Message to display.
message (String): Caption to display.
button (vcMessageBoxButton): Buttons to display.

Returns:
vcMessageBoxResult: Value that specifies which message box button is clicked by the user.
showvcMessageBoxResultString message,
String caption,
vcMessageBoxButton button,
vcMessageBoxImage image
Displays a message box with a message, title bar caption, buttons and image.
See more
Parameters:
message (String): Message to display.
message (String): Caption to display.
button (vcMessageBoxButton): Buttons to display.
image (vcMessageBoxImage): Image to display.

Returns:
vcMessageBoxResult: Value that specifies which message box button is clicked by the user.

Example: Open Message Box

"""Opens a MessageBox when the application is initialized"""

import vcCore as vc

def OnInit():
    vc.vcMessageBox.show("Hello!")

Example: Create Message Boxes

"""Example with different messageBox types and buttons"""
import vcCore as vc

comp = vc.getComponent()

def open_message_box(arg):
  #Simple version
  result = vc.vcMessageBox.show("Hello!")
  #Message box with a title
  result2 = vc.vcMessageBox.show("Here is a quiz about pancakes.", "Pancake quiz")
  #Box with different buttons
  button_result = vc.vcMessageBox.show("Do you like pancakes?", "Pancake quiz", vc.vcMessageBoxButton.YES_NO_CANCEL)
  #Checking which button was pressed and based on the result opening a message box with different text and image
  if button_result == vc.vcMessageBoxResult.YES:
    image_result = vc.vcMessageBox.show("I agree! Pancakes are great!", "Fellow pancake lover",vc.vcMessageBoxButton.OK, vc.vcMessageBoxImage.INFORMATION)
  elif button_result == vc.vcMessageBoxResult.NO:
    image_result = vc.vcMessageBox.show("Why don't you like pancakes?", "Pancake hater", vc.vcMessageBoxButton.OK, vc.vcMessageBoxImage.WARNING)
  else:
    image_result = vc.vcMessageBox.show("Why did you change the subject?", "Dodged the question", vc.vcMessageBoxButton.OK, vc.vcMessageBoxImage.ERROR)

#Get a button property from this component and add a event handler to when the button is clicked
my_button = comp.Properties["MyButton"]
my_button.OnChanged += open_message_box